home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////
- //
- // Shelves.js
- //
- // Code handling for shelves
- //
-
- // Set a new shelf mode
- function _SSetShelfMode( NewMode )
- {
- // Get ShelfMode
- ShelfMode = LTKGetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", -1 );
- ShelfMode = parseInt( ShelfMode );
-
- // make sure it's really a number
- if( isNaN( ShelfMode ) )
- {
- ShelfMode = 1;
- }
-
- // Make sure it's not 0
- if( ShelfMode == 0 )
- {
- ShelfMode = -1;
- }
-
- // Opening or closing shelf?
- if( NewMode == -1 )
- {
- NewMode = 0;
-
- // Click button
- SBClickButton( ShelfMode < 0 ? -ShelfMode : 0 );
- }
-
- // If mode is different, jump
- if( NewMode != ShelfMode )
- {
- if( NewMode == 0 )
- {
- ShelfMode = -ShelfMode;
- }
-
- else if( NewMode == 1 ) // photo shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/PhotoShelf.html' );
- ShelfMode = NewMode;
- }
-
- else if( NewMode == 2 ) // Project shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/ProjectShelf.html' );
- ShelfMode = NewMode;
- }
-
- else if( NewMode == 3 ) // album shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/AlbumShelf.html' );
- ShelfMode = NewMode;
- }
-
- else if( NewMode == 4 ) // Motion shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/MotionShelf.html' );
- ShelfMode = NewMode;
- }
-
- }
-
- // Store the ShelfMode back
- LTKSetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", ShelfMode );
-
- // Should window be visible?
- RightPane.cols = ShelfMode > 0 ? '*,128' : '*,0';
- }
-
- // Update shelf to reflect current mode
- function _SUpdateShelves()
- {
- // Get ShelfMode
- ShelfMode = LTKGetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", 0 );
- ShelfMode = parseInt( ShelfMode );
-
- // make sure it's really a number
- if( isNaN( ShelfMode ) )
- {
- ShelfMode = 0;
- }
-
- // Don't click when the shelf is closed
- if( ShelfMode > 0 )
- {
- // Press the button
- SBClickButton( ShelfMode );
- }
-
- if( ShelfMode == 1 || ShelfMode == -1 ) // photo shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/PhotoShelf.html' );
- }
-
- else if( ShelfMode == 2 || ShelfMode == -2 ) // Project shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/ProjectShelf.html' );
- }
-
- else if( ShelfMode == 3 || ShelfMode == -3 ) // album shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/AlbumShelf.html' );
- }
-
- else if( ShelfMode == 4 || ShelfMode == -4 ) // Motion shelf
- {
- SmartJump( window.frames('ShelfTarget'), '../Common/MotionShelf.html' );
- }
-
- // Should window be visible?
- RightPane.cols = ShelfMode > 0 ? '*,128' : '*,0';
- }
-
-